document.write('<script src="' + context
		+ '/system/wordbook/js/wblist.js"></script>');
document.write('<script src="' + context
		+ '/system/purview/js/purviewlistmulti4tab.js"></script>');
document.write('<script src="' + context
		+ '/system/purview/js/purviewobjselect.js"></script>');
		
/**
 * render td
 * 
 * @param {}
 *            value
 * @param {}
 *            cellmeta
 * @param {}
 *            record
 * @param {}
 *            rowIndex
 * @param {}
 *            columnIndex
 * @param {}
 *            store
 * @return {}
 */
function renderTQJspListHeader(value, cellmeta, record, rowIndex, columnIndex, store) {
	var cm =  getGridCm('gdzctemppurviewlist');
	var fieldName = cm.getDataIndex(columnIndex);
	if (fieldName == 'TDATE') {
		return formatDate(value);
	} else if (fieldName == 'TSTATUS') {
		return (value == -1 ? '<font color="red">已停用</font>' : '已启用');
	} else if (fieldName == 'SP') {
		var resultString = String
				.format(
						'<a href="javascript:void(0);" onClick="javascript:handlePurview(\'{0}\', \'{1}\')">使用授权</a>',
						record.data['ID'], record.data['TNAME']);

		return resultString;
	}
	return value;
}

/**
 * 处理状态
 * 
 * @param {}
 *            id
 * @param {}
 *            status
 */
function handlePurview(id, name) {
	var p = purviewList4multi(id, name, 'gztemp', 'APP_GDZC_TEMPLATE', 'purview4gz', null);

	var win = new Ext.Window({
				title : name + '_使用权限设置',
				layout : 'fit',
				items : [p],
				plain : true,
				modal : true,
				width : 600,
				height : 500,
				listeners : {
					'show' : function() {
					}
				},
				buttons : [{
							text : '关闭',
							handler : function() {
								win.close();
								win = null;
							}
						}]
			});

	win.show(this);
}
